package com.jjh.utils;

/**
 * 验证码存储工具
 */
public class CheckCodeThreadLocal {

    private static final ThreadLocal<String> checkCodeLocal = new ThreadLocal<>();


    public static void setCheckCode(String checkCode) {
        System.out.println("设置验证码:"+checkCode);
          checkCodeLocal.set(checkCode);
    }

    public static String getCheckCode(){
        System.out.println("获取验证码：...");
        return checkCodeLocal.get();
    }

    public static void removeCheckCode(){
       if(checkCodeLocal.get()!=null){
           checkCodeLocal.remove();
       }
    }
}
